/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

package com.huawei.ock.bss.metric;

/**
 * Represent Property values using an int value
 *
 * @since BeiMing 25.2
 */
public enum Statistics {
    // [0, 100) MemoryManager
    MEMORY_MAX_FRESH(0),
    MEMORY_MAX_SLICE(1),
    MEMORY_MAX_FILE(2),
    MEMORY_MAX_SNAPSHOT(3),
    MEMORY_MAX_DB(4),
    MEMORY_MAX_BORROW_HEAP(5),
    MEMORY_USED_FRESH(6),
    MEMORY_USED_SLICE(7),
    MEMORY_USED_FILE(8),
    MEMORY_USED_SNAPSHOT(9),
    MEMORY_USED_DB(10),
    MEMORY_USED_BORROW_HEAP(11),

    // [100, 200) FreshTable
    FRESH_HIT_COUNT(100),
    FRESH_MISS_COUNT(101),
    FRESH_RECORD_COUNT(102),
    FRESH_FLUSHING_RECORD_COUNT(103),
    FRESH_FLUSHING_SEGMENT_COUNT(104),
    FRESH_FLUSHED_RECORD_COUNT(105),
    FRESH_FLUSHED_SEGMENT_COUNT(106),
    FRESH_SEGMENT_CREATE_FAIL_COUNT(107),
    FRESH_FLUSH_COUNT(108),
    FRESH_BINARY_KEY_SIZE(109),
    FRESH_BINARY_VALUE_SIZE(110),
    FRESH_BINARY_MAP_NODE_SIZE(111),
    FRESH_WASTED_SIZE(112),

    // [200, 300) SliceTable
    SLICE_HIT_COUNT(200),
    SLICE_MISS_COUNT(201),
    SLICE_READ_COUNT(202),
    SLICE_READ_AVG_SIZE(203),
    SLICE_EVICT_SIZE(204),
    SLICE_EVICT_WAITING_COUNT(205),
    SLICE_COMPACTION_COUNT(206),
    SLICE_COMPACTION_SLICE_COUNT(207),
    SLICE_COMPACTION_AVG_SLICE_COUNT(208),
    SLICE_CHAIN_AVG_SIZE(209),
    SLICE_AVG_SIZE(210),

    // [300, 400) FileCache
    INDEX_BLOCK_HIT_COUNT(301),
    INDEX_BLOCK_HIT_SIZE(302),
    INDEX_BLOCK_MISS_COUNT(303),
    INDEX_BLOCK_MISS_SIZE(304),
    INDEX_BLOCK_CACHE_COUNT(305),
    INDEX_BLOCK_CACHE_SIZE(306),
    DATA_BLOCK_HIT_COUNT(307),
    DATA_BLOCK_HIT_SIZE(308),
    DATA_BLOCK_MISS_COUNT(309),
    DATA_BLOCK_MISS_SIZE(310),
    DATA_BLOCK_CACHE_COUNT(311),
    DATA_BLOCK_CACHE_SIZE(312),
    FILTER_HIT_COUNT(313),
    FILTER_HIT_SIZE(314),
    FILTER_MISS_COUNT(315),
    FILTER_MISS_SIZE(316),
    FILTER_CACHE_COUNT(317),
    FILTER_CACHE_SIZE(318),
    FILTER_SUCCESS_COUNT(319),
    FILTER_EXIST_SUCCESS_COUNT(320),
    FILTER_EXIST_FAIL_COUNT(321),

    // [400, 600) FileStore
    LSM_FLUSH_COUNT(400),
    LSM_FLUSH_SIZE(401),
    LSM_COMPACTION_COUNT(402),
    LSM_HIT_COUNT(403),
    LSM_MISS_COUNT(404),
    LEVEL0_HIT_COUNT(405),
    LEVEL0_MISS_COUNT(406),
    LEVEL1_HIT_COUNT(407),
    LEVEL1_MISS_COUNT(408),
    LEVEL2_HIT_COUNT(409),
    LEVEL2_MISS_COUNT(410),
    ABOVE_LEVEL2_HIT_COUNT(411),
    ABOVE_LEVEL2_MISS_COUNT(412),
    LEVEL0_FILE_SIZE(413),
    LEVEL1_FILE_SIZE(414),
    LEVEL2_FILE_SIZE(415),
    LEVEL3_FILE_SIZE(416),
    ABOVE_LEVEL3_FILE_SIZE(417),
    LSM_FILE_SIZE(418),
    LSM_COMPACTION_READ_SIZE(419),
    LSM_COMPACTION_WRITE_SIZE(420),
    LEVEL0_COMPACTION_RATE(421),
    LEVEL1_COMPACTION_RATE(422),
    LEVEL2_COMPACTION_RATE(423),
    LEVEL3_COMPACTION_RATE(424),
    LSM_COMPACTION_RATE(425),
    LSM_FILE_COUNT(439),

    // [600, 700) restore
    RESTORE_LAZY_DOWNLOAD_TIME(600),
    ;

    private final int value;

    private Statistics(int value) {
        this.value = value;
    }

    /**
     * getValue
     *
     * @return int
     */
    public int getValue() {
        return this.value;
    }
}
